﻿package we3d.material 
{
	import we3d.rasterizer.IRasterizer;
	import we3d.rasterizer.NativeFlat;
	import we3d.mesh.Face;
	
	/** 
	* Surfaces of polygons
	*/
	public class Surface 
	{
		public function Surface (_rasterizer:IRasterizer=null, _attributes:ISurfaceAttributes=null) {
			rasterizer = _rasterizer || defaultRasterizer;
			attributes = _attributes || defaultAttributes;
		}
		
		/** 
		* Hide or display backfaces 
		*/
		public var hideBackfaces:Boolean = true;
		
		public var rasterizer:IRasterizer;
		public var attributes:ISurfaceAttributes;
		
		public static var defaultRasterizer:IRasterizer = new NativeFlat();
		public static var defaultAttributes:ISurfaceAttributes = new FlatAttributes();
		
		/**
		* @private
		* @param	f the face
		*/
		public function initFace (f:Face) :void {
			if(attributes) attributes.initFace(f);
		}
		
	}
}